<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/public/common.jspf" %>
<html>
<head>
    <title>角色管理</title>
</head>
<body>
<div class="col-sm-9">
    <div class="row">
        <div class="col-lg-12">
            <div class="page-header">
                <h1>角色管理</h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <%@ include file="/WEB-INF/jsp/public/pageinfo.jspf" %>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="text-muted bootstrap-admin-box-title">角色列表</div>
                </div>
                <div class="bootstrap-admin-panel-content">
                    <table class="table bootstrap-admin-table-with-actions">
                        <thead>
                        <tr>
                            <th>角色名称</th>
                            <th>描述</th>
                            <th>默认角色</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <s:iterator value="recordList">
                            <tr>
                                <td>${name}</td>
                                <td>
                                    <s:if test="%{description.length() gt 20}">
                                        <s:property value="%{description.substring(0,20)+' ...'}"/>
                                    </s:if>
                                    <s:else>
                                        ${description}
                                    </s:else>
                                <td>
                                    <s:if test="%{isDefault==true}"><i class="glyphicon glyphicon-ok-sign"></s:if>
                                </td>
                                <td class="actions">
                                    <s:a cssClass="btn btn-sm btn-success" action="roleManage_setPrivilegeUI?id=%{id}">
                                        设置权限
                                    </s:a>
                                    <s:a cssClass="btn btn-sm btn-danger" action="roleManage_delete?id=%{id}"
                                         onclick="return confirm('确定要删除该用户么？')">
                                        删除
                                    </s:a>
                                    <s:a cssClass="btn btn-sm btn-info" action="roleManage_editUI?id=%{id}">
                                        编辑
                                    </s:a>
                                    <s:a cssClass="btn btn-sm btn-info" action="roleManage_setDefaultRole?id=%{id}">
                                        设为默认
                                    </s:a>
                                </td>
                            </tr>
                        </s:iterator>
                        </tbody>
                    </table>

                    <!--pager start-->
                    <%@ include file="/WEB-INF/jsp/public/pageView.jspf" %>
                    <s:form action="roleManage_list" cssstyle="display:none"></s:form>
                    <!--pager end-->

                </div>
            </div>
        </div>
    </div>

    <s:a cssClass="btn btn-sm btn-info" action="roleManage_addUI">
        <i class="glyphicon glyphicon-plus glyphicon-white">
        </i> 添加角色</s:a>
</div>
</body>
</html>
